import request from '../utils/request'

export const reqCode = (phone) =>
  request({
    method: 'get',
    url: `/user/passport/sendCode/${phone}`,
  })
export const reqRegister = ({ phone, password, code }) =>
  request({
    method: 'post',
    url: `/user/passport/register/`,
    data: { phone, password, code },
  })

export const reqLogin = ({ phone, password }) =>
  request({
    method: 'post',
    url: `/user/passport/login`,
    data: { phone, password },
  })

export const reqLogout = () =>
  request({
    method: 'get',
    url: '/user/passport/logout',
  })
